const { app, Tray, Menu } = require("electron");
const indexWindow = require("./utils/index/index");
const path = require('path')
function createTray() {
  let tray = new Tray(path.join(__dirname, "./static/img/favicon.ico"));
  const contextMenu = Menu.buildFromTemplate([
    {
      label: "退出应用",
      click: () => {
        app.exit();
      },
    },
  ]);

  tray.setToolTip("We-Talk");
  tray.setContextMenu(contextMenu);
  tray.on('click', () => {
    indexWindow.getWindow().show()
  })
}
app.whenReady().then(() => {
  indexWindow.createWindow();
  createTray();
});